package com.hopes.bizz.poll.gis.vo;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.bizz.poll.common.constant.enums.PollModDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import lombok.Data;

import java.util.Date;

/**
 * @author: cx
 * @create: 2023/10/08
 * 大气一张图数据监测展示*
 */
@Data
public class GisWater {

    private Long id;

    private String name;

    /**
     * 监控点类型
     */
    private Integer monitorType;
    /**
     * 监控点位置
     */
    private String monitorLocation;

    /**
     * 定位
     */
    private String gisLocation;

    /**
     * 数据时间
     */
    private Date dataTime;
    /**
     * 监测数据json对象{"w00000": {key: "w00000", val: "11.2", *** }}
     */
    @TableField(value = "data_json", typeHandler = JacksonTypeHandler.class)
    private JSONObject dataJson;

    /**
     * wqi数据
     * * * */
    private Double wqiData;


    public String getDataTimeStr() {
        return DateUtils.limitMinute(this.dataTime);
    }

    public String getMonitorSiteStr() {
        return DictResolver.getItemLabelByValue(PollModDictEnum.monitor_site, this.id);
    }
}
